﻿using HCQ2_IBLL;
using HCQ2_Model.VRDD.InputDto._0602;
using HCQ2_Model.VRDD.OutputDto._0602;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace HCQ2_BLL
{
    public partial class T_VRDDCircleUserServiceBLL: IT_VRDDCircleUserServiceBLL
    {
        /// <summary>
        ///  用户服务数据层接口
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public List<OutputSaveService> GetServiceList(InputSaveService param, decimal gps_x, decimal gps_y)
        {
            var list = DBSession.IT_VRDDCircleUserServiceDAL.GetServiceList(param, gps_x,gps_y);
            list?.ForEach(s =>
            {
                if (!string.IsNullOrEmpty(s.user_img) && s.user_img.IndexOf("http")<0)
                    s.user_img = s.user_img.Replace("~", HttpContext.Current.Request.Url.AbsoluteUri.Substring(0, HttpContext.Current.Request.Url.AbsoluteUri.IndexOf("/api/")));
                if (!string.IsNullOrEmpty(s.voice_url))
                    s.voice_url = s.voice_url.Replace("~", HttpContext.Current.Request.Url.AbsoluteUri.Substring(0, HttpContext.Current.Request.Url.AbsoluteUri.IndexOf("/api/")));
            });
            return list;
        }
    }
}